﻿using ReflectionStudio.Core.Events;
using System;
using System.ComponentModel;
using System.Data;
using System.Windows;
using WPFExcelReport.Helpers;
namespace WPFExcelReport
{
    public partial class TAB14WV
    {

        public TAB14WV()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VABPR();
            this.DataContext = MV;
            InitializeComponent();
        }
        public override void vwMaster_CurrentChanged(object sender, EventArgs e)
        {
            base.vwMaster_CurrentChanged(sender, e);
            if(dwMaster==null)
            {

            }
            else
            { 
                SPEED = double.Parse(dwMaster["WTGNFTOLM"].ToString());
                EFFICIENCY = double.Parse(dwMaster["WTGNFTOLP"].ToString());
                GFDISM = double.Parse(dwMaster["WTGFDISM"].ToString()); 
            }
        }
        public override void LOADBYAUF()
        {
            if (!IsCanLoad)
                return;
            TBMain.Clear();
            if (ORDERNUM == "")
                return;
            dwData = TBMain.NewRow();
            dwData["ARMANDANT"] = app.Mandant;
            dwData["ARAUFKRS"] = ORDERNUM.Substring(0, 2);
            dwData["ARAUFLFD"] = ORDERNUM.Substring(2, 6);
            dwData["ARAUFPOS"] = ORDERNUM.Substring(8, 3);
            SResult =TMV.QABPR03(dwData);
            MergeData(SResult, true);
        }
    }
}
